1 using UnityEngine;
2 using
System.Collections;
3
4 public
class Descriptions : MonoBehaviour {
5
6     
public Descript descript1;
7     
public Descript descript2;
8     
public Descript nameDes;
9     
10
11     
public void Start () {
12         BitmapFont desFont =
new BitmapFont("Fonts/des_font", "Fonts/des_font_xml", gameObject);
13         descript1.setDesFont(desFont, Color.yellow);
14         descript2.setDesFont(desFont, Color.yellow);
15         descript1.setText(
"Pick your skill");
16
17         BitmapFont shopFont =
new BitmapFont("Fonts/shop_font", "Fonts/shop_font_xml", gameObject);
18         nameDes.setDesFont(shopFont);
19     }
20
21     
public void setText(string text1, string text2, string name, int starUnlock)
22     {
23         
if (starUnlock == -1)
24         {
25             descript1.setText(text1);
26             descript2.setText(text2);
27             nameDes.setText(name);
28         }
29         
else {
30             descript1.setText(
"");
31             descript2.setText(
"");
32             nameDes.setText(
"Need " + starUnlock + " *");
33         }
34     }
35 }



Trò chơi đua xe động vật trong UNITY Engine 114.614 lượt xem

Gõ tìm kiếm nhanh...